home *** CD-ROM | disk | FTP | other *** search
/ PC-SIG: World of Education / PC-SiG's World of Education.iso / run / 2602 / asciiinp.hlp < prev    next >
Encoding:
Text File  |  1989-06-04  |  4.5 KB  |  96 lines

  1. READ File Format
  2.  
  3. The READ function processes ASCII text records containing a mixture of
  4. time tag fields (i.e.  the independent variable's value), one or more
  5. data fields, and optional comments.  The carriage return character is
  6. used as a record separator and spaces, commas, tabs, or comments are
  7. used as field separators within records.
  8.  
  9. Comments are any string of characters (except '}') enclosed between a
  10. '{' and a '}' or between pairs of double quote characters ("). 
  11. Comments may appear anywhere within the file except between the
  12. characters of a time tag or data field; i.e.  if a data field is e.g. 
  13. '12' then a comment should not appear between the '1' and the '2'. 
  14. Comments may be continued across records but should not, in this case,
  15. appear between time tag or data fields.
  16. +
  17. An example comment is:
  18.     {Entry   High   Low   Close   Date     Time}
  19.  
  20. The first field in a record (i.e.  the first field on the line
  21. following a carriage return) is considered to be the time tag for all
  22. subsequent values in the record.  Time tag fields should be in
  23. increasing order.  All fields following the time tag are data fields
  24. until another carriage return is encountered.  For example,
  25.  
  26.       1.2     4E1     2    3.625   7/7/86  13:45:22.5<CR><LF>
  27. where:
  28.      1.2                is the time tag.
  29.      4E1, 2 and 3.625   are numeric data fields.
  30.      7/7/86             is a date data field.
  31.      13:45:22.5         is a time data field.
  32.  
  33. Time tag and data fields may have any of the formats that constants
  34. may have, except the leading '#' character must not be used (see
  35. Constants topic).
  36. +
  37. When processing a file whose records contain multiple data fields on
  38. the same line, multiple READ function calls must be used; one READ call
  39. for each data field.  These READ calls may be grouped via the '&'
  40. statement terminator, occur multiple times in an expression (e.g. READ+
  41. READ), or a combination of both.  Each occurrence of a READ causes one
  42. data value (time tag values do not count) to be read from the ASCII
  43. file.  For example, to process an ASCII file containing records as in
  44. the above example, the following statements might be employed:
  45.  
  46.           high = READ &  low = READ &   close = READ &
  47.           quote_date = READ &  quote_time = READ;
  48.  
  49. The DAN algorithm could then go on to reference the files 'high',
  50. 'low', 'close', 'quote_date', and 'quote_time' in subsequent
  51. statements.  See the PLOTSTOK and PLOTSPOT examples and use the text
  52. editor to examine the data files used in these algorithms.
  53. +
  54. Since DAN performs a linear interpolation to determine the value of a
  55. function at step times other than those explicitly given, it is not
  56. necessary for time tag values to be evenly spaced between records (i.e. 
  57. the difference between time tags for successive records does not have
  58. to be a constant value).  Also, there is no requirement on the number
  59. of records.
  60.  
  61. If the algorithm does not specify START or DUR values, the READ
  62. function will automatically set these control values from the first
  63. time tag in the file and the time span processed during input.  That
  64. is, START is set to the first time tag, and DUR is set to the
  65. difference between the last time tag found and the first time tag. 
  66. These become the default values for subsequent processing.
  67. +
  68. Accepting OPER Input From A Text File
  69. -------------------------------------
  70.  
  71. A less flexible, but still usable, way to enter data from a text file
  72. is to use the I/O redirection facilities of DOS and the OPER predefined
  73. variable.
  74.  
  75. In this method the user creates a text file containing just data values
  76. (no time tags).  There must be one data value for each step time in the
  77. processing algorithm and the data values must correspond to the even
  78. spacing specified by the STEP value used in the algorithm.  Comments
  79. are not allowed in this text file.
  80.  
  81. An algorithm is then created that references the OPER variable when
  82. successive values from the text file are desired.
  83. +
  84. The user then invokes DAN  with the following command line:
  85.  
  86.        C>DAN algor_name <text_file
  87.  
  88. where `algor_name' is the name given to the algorithm file and
  89. `text_file' is the file name of the data file.  Note that only one data
  90. file can be input this way since I/O redirection only applies to one
  91. file.  The `Suppress OPER Prompt' Execution Option is used to suppress
  92. the message that is normally output when operator input is expected.
  93.  
  94. If the number of data points changes then the STEP and/or DUR values
  95. must be changed in the algorithm.
  96.